﻿namespace System.Web.Mvc
{
    /// <summary>
    /// 路由名称属性
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class RouteNameAttribute : Attribute
    {
        /// <summary>
        /// 初始化一个新的 <see cref="RouteNameAttribute"/> 类的实例
        /// </summary>
        /// <param name="name">名称</param>
        public RouteNameAttribute(string name)
        {
            if (name == null) throw new ArgumentNullException("name");
            this.Name = name;
        }

        /// <summary>
        /// 获取或设置名称
        /// </summary>
        public string Name { get; private set; }
    }
}
